package uc108.com.jetpackdemo.observer;

import android.util.Log;

import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleObserver;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.OnLifecycleEvent;

public class DefaultObserver implements LifecycleObserver {

    private final static String TAG = "LifecycleObserver";

    @OnLifecycleEvent(Lifecycle.Event.ON_ANY)
    public void onEventAny(LifecycleOwner owner){
        Log.e(TAG,"onEventAny  " +owner);
    }

    @OnLifecycleEvent(Lifecycle.Event.ON_CREATE)
    public void onEventCreate(){
        Log.e(TAG,"onEventCreate   ");
    }

    @OnLifecycleEvent(Lifecycle.Event.ON_START)
    public void onEventStart(){
        Log.e(TAG,"onEventStart");
    }

    @OnLifecycleEvent(Lifecycle.Event.ON_RESUME)
    public void onEventResume(){
        Log.e(TAG,"onEventResume");
    }

    @OnLifecycleEvent(Lifecycle.Event.ON_PAUSE)
    public void onEventPause(){
        Log.e(TAG,"onEventPause");
    }


    @OnLifecycleEvent(Lifecycle.Event.ON_STOP)
    public void onEventStop(){
        Log.e(TAG,"onEventStop");
    }

    @OnLifecycleEvent(Lifecycle.Event.ON_DESTROY)
    public void onEventDestroy(){
        Log.e(TAG,"onEventDestroy");
    }
}
